package org.lq.er.view.admin;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import org.lq.er.entity.Admin;
import org.lq.er.view.announcement.Admin_announcement;
import org.lq.er.view.scoreManege.V_ScoreManage;
import org.lq.er.view.student_info.ER_student_main;
import org.lq.er.view.subject.V_subject_main;

import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.border.TitledBorder;
import java.awt.Color;

public class V_admin_manage extends JFrame {

	private JPanel contentPane;
	private static Admin admin;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					V_admin_manage frame = new V_admin_manage(admin);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public V_admin_manage(Admin admin) {
		setTitle("管理员界面");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 449, 439);
		setLocationRelativeTo(null);
		contentPane = new JPanel();
		contentPane.setBackground(Color.WHITE);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JPanel panel = new JPanel();
		panel.setBackground(Color.WHITE);
		panel.setBounds(10, 10, 413, 364);
		contentPane.add(panel);
		panel.setLayout(null);

		JButton btnNewButton_1 = new JButton("学生管理");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ER_student_main student = new ER_student_main();
				student.setVisible(true);
			}
		});
		btnNewButton_1.setBounds(73, 118, 111, 23);
		panel.add(btnNewButton_1);

		if (admin.getStatus() == 0) {
			JButton btnNewButton = new JButton("职员管理");
			btnNewButton.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					
					V_admin_aduq admin = new V_admin_aduq();
					admin.setVisible(true);
				}
			});

			btnNewButton.setBounds(73, 69, 111, 23);
			panel.add(btnNewButton);
		}

		JButton btnNewButton_2 = new JButton("公告管理");
		btnNewButton_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Admin_announcement announcement = new Admin_announcement();
				announcement.setVisible(true);
			}
		});
		btnNewButton_2.setBounds(73, 167, 111, 23);
		panel.add(btnNewButton_2);

		JButton btnNewButton_3 = new JButton("科目管理");
		btnNewButton_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				V_subject_main subject = new V_subject_main();
				subject.setVisible(true);
			}
		});
		btnNewButton_3.setBounds(73, 217, 111, 23);
		panel.add(btnNewButton_3);
		
		JButton btnNewButton_4 = new JButton("成绩管理");
		btnNewButton_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				V_ScoreManage scoreManage = new V_ScoreManage();
				scoreManage.setVisible(true);
			}
		});
		btnNewButton_4.setBounds(73, 266, 111, 23);
		panel.add(btnNewButton_4);
	}
}
